
package com.horizon.mobile.view;

import zuo.biao.library.base.BaseView;
import zuo.biao.library.util.StringUtil;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.horizon.mobile.R;
import com.horizon.mobile.activity.FlowDetailActivity;
import com.horizon.mobile.model.Agent;
public class HandReciveView extends BaseView<Agent> implements OnClickListener {

	public HandReciveView(Activity context, Resources resources) {
		super(context, resources);
	}

	public TextView tvFlowName;

	public TextView tvTitle;
	public TextView tvTime;

	@SuppressLint("InflateParams")
	@Override
	public View createView(LayoutInflater inflater) {
		convertView = inflater.inflate(R.layout.todo_view, null);
		tvFlowName = findViewById(R.id.tvFlowname, this);
		tvTitle = findViewById(R.id.tvTitle, this);
		tvTime = findViewById(R.id.tvTime, this);
		tvTime.setVisibility(View.VISIBLE);
		return convertView;
	}

	@Override
	public void bindView(Agent data){
		if (data == null) {
			data = new Agent();
		}
		this.data = data;
		tvFlowName.setText(StringUtil.getTrimedString(data.getFlowName()));
		tvTitle.setText( StringUtil.getNoBlankString(data.getTitle()));
		tvTime.setText(data.getDoTime());
	}

	@Override
	public void onClick(View v) {
//		if (BaseModel.isCorrect(data) == false) {
//			return;
//		}
		toActivity(FlowDetailActivity.createIntent(context,
				data.getId(), data
						.getTitle(),data.getTrackId(),""));
//		switch (v.getId()) {
//		
//		}
	}
}